package com.example.template.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @author Buer
 * @date 2021/04/27 实现WebMvcConfigurer接口，扩展MVC
 */
@Configuration
public class MyMvcConfig implements WebMvcConfigurer {
    
    @Override
    public void addViewControllers(ViewControllerRegistry registry) {
        // 实现接口跳转
        registry.addViewController("/login.html").setViewName("login");
        registry.addViewController("/Login").setViewName("login");
        registry.addViewController("").setViewName("login");
    }
}
